home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / AIncludes / QD3DRenderer.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  40.4 KB  |  1,270 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        QD3DRenderer.a
  3. ;
  4. ;    Contains:    Q3Renderer types and routines                                          
  5. ;
  6. ;    Version:    Technology:    Quickdraw 3D 1.5.4
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__QD3DRENDERER__') = 'UNDEFINED' THEN
  18. __QD3DRENDERER__ SET 1
  19.  
  20.     IF &TYPE('__QD3D__') = 'UNDEFINED' THEN
  21.     include 'QD3D.a'
  22.     ENDIF
  23.     IF &TYPE('__QD3DSET__') = 'UNDEFINED' THEN
  24.     include 'QD3DSet.a'
  25.     ENDIF
  26.     IF &TYPE('__QD3DVIEW__') = 'UNDEFINED' THEN
  27.     include 'QD3DView.a'
  28.     ENDIF
  29.  
  30.     IF TARGET_OS_MAC THEN
  31.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  32.     include 'Events.a'
  33.     ENDIF
  34.     ENDIF    ; TARGET_OS_MAC
  35. ; ******************************************************************************
  36. ; **                                                                             **
  37. ; **                            User Interface Things                             **
  38. ; **                                                                             **
  39. ; ****************************************************************************
  40.  
  41.     IF TARGET_OS_MAC THEN
  42. ; *  A callback to an application's event handling code. This is needed to    
  43. ; *  support movable modal dialogs. The dialog's event filter calls this      
  44. ; *  callback with events it does not handle.                                 
  45. ; *  If an application handles the event it should return kQ3True.            
  46. ; *  If the application does not handle the event it must return kQ3False and 
  47. ; *  the dialog's event filter will pass the event to the system unhandled.   
  48.  
  49. TQ3DialogAnchor            RECORD 0
  50. clientEventHandler         ds.l    1                ; offset: $0 (0)
  51. sizeof                     EQU *                    ; size:   $4 (4)
  52.                         ENDR
  53.     ENDIF    ; TARGET_OS_MAC
  54.     IF TARGET_OS_WIN32 THEN
  55. TQ3DialogAnchor            RECORD 0
  56. ownerWindow                 ds.l    1                ; offset: $0 (0)
  57. sizeof                     EQU *                    ; size:   $4 (4)
  58.                         ENDR
  59.     ENDIF    ; TARGET_OS_WIN32
  60.     IF TARGET_OS_UNIX THEN
  61. TQ3DialogAnchor            RECORD 0
  62. notUsed                     ds.l    1                ; offset: $0 (0)        ;  place holder 
  63. sizeof                     EQU *                    ; size:   $4 (4)
  64.                         ENDR
  65.     ENDIF    ; TARGET_OS_UNIX
  66. ; ******************************************************************************
  67. ; **                                                                             **
  68. ; **                            Renderer Functions                                 **
  69. ; **                                                                             **
  70. ; ****************************************************************************
  71.  
  72. ;
  73. ; extern TQ3RendererObject Q3Renderer_NewFromType(TQ3ObjectType rendererObjectType)
  74. ;
  75.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  76.         IMPORT_CFM_FUNCTION Q3Renderer_NewFromType
  77.     ENDIF
  78.  
  79. ;
  80. ; extern TQ3ObjectType Q3Renderer_GetType(TQ3RendererObject renderer)
  81. ;
  82.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  83.         IMPORT_CFM_FUNCTION Q3Renderer_GetType
  84.     ENDIF
  85.  
  86.  
  87. ;  Q3Renderer_Flush has been replaced by Q3View_Flush 
  88. ;  Q3Renderer_Sync has been replaced by Q3View_Sync 
  89.  
  90. ; *    Q3Renderer_IsInteractive
  91. ; *        Determine if this renderer is intended to be used interactively.
  92.  
  93. ;
  94. ; extern TQ3Boolean Q3Renderer_IsInteractive(TQ3RendererObject renderer)
  95. ;
  96.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  97.         IMPORT_CFM_FUNCTION Q3Renderer_IsInteractive
  98.     ENDIF
  99.  
  100.  
  101. ; *    Q3Renderer_HasModalConfigure
  102. ; *        Determine if this renderer has a modal settings dialog.
  103. ; *
  104. ; *    Q3Renderer_ModalConfigure
  105. ; *        Have the renderer pop up a modal dialog box to configure its settings.
  106. ; *    dialogAnchor - is platform specific data passed by the client to support
  107. ; *      movable modal dialogs. 
  108. ; *    MacOS: this is a callback to the calling application's event handler.
  109. ; *      The renderer calls this function with events not handled by the 
  110. ; *      settings dialog. This is necessary in order to support movable modal 
  111. ; *      dialogs. An application's event handler must return kQ3True if it 
  112. ; *      handles the event passed to the callback or kQ3False if not. 
  113. ; *      An application which doesn't want to support a movable modal configure
  114. ; *      dialog should pass NULL for the clientEventHandler of TQ3DialogAnchor.
  115. ; *    Win32: this is the HWND of the owning window (typically an application's
  116. ; *      main window).
  117. ; *  canceled - returns a boolean inditacating that the user canceled the 
  118. ; *    dialog.
  119. ; *      
  120.  
  121. ;
  122. ; extern TQ3Boolean Q3Renderer_HasModalConfigure(TQ3RendererObject renderer)
  123. ;
  124.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  125.         IMPORT_CFM_FUNCTION Q3Renderer_HasModalConfigure
  126.     ENDIF
  127.  
  128. ;
  129. ; extern TQ3Status Q3Renderer_ModalConfigure(TQ3RendererObject renderer, TQ3DialogAnchor dialogAnchor, TQ3Boolean *canceled)
  130. ;
  131.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  132.         IMPORT_CFM_FUNCTION Q3Renderer_ModalConfigure
  133.     ENDIF
  134.  
  135. ; *    Q3RendererClass_GetNickNameString
  136. ; *        Allows an application to get a renderers name string, the 
  137. ; *        renderer is responsible for storing this in a localizable format
  138. ; *        for example as a resource.  This string can then be used to provide
  139. ; *        a selection mechanism for an application (for example in a menu).
  140. ; *
  141. ; *        If this call returns nil in the supplied string, then the App may 
  142. ; *         choose to use the class name for the renderer.  You should always 
  143. ; *        try to get the name string before using the class name, since the
  144. ; *        class name is not localizable.
  145.  
  146. ;
  147. ; extern TQ3Status Q3RendererClass_GetNickNameString(TQ3ObjectType rendererClassType, TQ3ObjectClassNameString rendererClassString)
  148. ;
  149.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  150.         IMPORT_CFM_FUNCTION Q3RendererClass_GetNickNameString
  151.     ENDIF
  152.  
  153.  
  154. ; *    Q3Renderer_GetConfigurationData
  155. ; *        Allows an application to collect private renderer configuration data
  156. ; *      which it will then save. For example in a preference file or in a 
  157. ; *        style template. An application should tag this data with the 
  158. ; *        Renderer's object  name.
  159. ; *    
  160. ; *        if dataBuffer is NULL actualDataSize returns the required size in 
  161. ; *        bytes of a data buffer large enough to store private data. 
  162. ; *
  163. ; *      bufferSize is the actual size of the memory block pointed to by 
  164. ; *        dataBuffer
  165. ; *
  166. ; *        actualDataSize - on return the actual number of bytes written to the 
  167. ; *        buffer or if dataBuffer is NULL the required size of dataBuffer
  168. ; * 
  169.  
  170. ;
  171. ; extern TQ3Status Q3Renderer_GetConfigurationData(TQ3RendererObject renderer, unsigned char *dataBuffer, unsigned long bufferSize, unsigned long *actualDataSize)
  172. ;
  173.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  174.         IMPORT_CFM_FUNCTION Q3Renderer_GetConfigurationData
  175.     ENDIF
  176.  
  177. ;
  178. ; extern TQ3Status Q3Renderer_SetConfigurationData(TQ3RendererObject renderer, unsigned char *dataBuffer, unsigned long bufferSize)
  179. ;
  180.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  181.         IMPORT_CFM_FUNCTION Q3Renderer_SetConfigurationData
  182.     ENDIF
  183.  
  184.  
  185.  
  186. ; ******************************************************************************
  187. ; **                                                                             **
  188. ; **                        Interactive Renderer Specific Functions                 **
  189. ; **                                                                             **
  190. ; ****************************************************************************
  191.  
  192. ;  CSG IDs attribute 
  193. ;  Object IDs, to be applied as attributes on geometries 
  194.  
  195. kQ3AttributeTypeConstructiveSolidGeometryID EQU 'csgi'
  196.  
  197. kQ3SolidGeometryObjNone            EQU        -1
  198. kQ3SolidGeometryObjA            EQU        0
  199. kQ3SolidGeometryObjB            EQU        1
  200. kQ3SolidGeometryObjC            EQU        2
  201. kQ3SolidGeometryObjD            EQU        3
  202. kQ3SolidGeometryObjE            EQU        4
  203. ;  Possible CSG equations 
  204.  
  205. ; typedef long                            TQ3CSGEquation
  206. kQ3CSGEquationAandB                EQU        $88888888
  207. kQ3CSGEquationAandnotB            EQU        $22222222
  208. kQ3CSGEquationAanBonCad            EQU        $2F222F22
  209. kQ3CSGEquationnotAandB            EQU        $44444444
  210. kQ3CSGEquationnAaBorCanB        EQU        $74747474
  211. ;
  212. ; extern TQ3Status Q3InteractiveRenderer_SetCSGEquation(TQ3RendererObject renderer, TQ3CSGEquation equation)
  213. ;
  214.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  215.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_SetCSGEquation
  216.     ENDIF
  217.  
  218. ;
  219. ; extern TQ3Status Q3InteractiveRenderer_GetCSGEquation(TQ3RendererObject renderer, TQ3CSGEquation *equation)
  220. ;
  221.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  222.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_GetCSGEquation
  223.     ENDIF
  224.  
  225. ;
  226. ; extern TQ3Status Q3InteractiveRenderer_SetPreferences(TQ3RendererObject renderer, long vendorID, long engineID)
  227. ;
  228.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  229.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_SetPreferences
  230.     ENDIF
  231.  
  232. ;
  233. ; extern TQ3Status Q3InteractiveRenderer_GetPreferences(TQ3RendererObject renderer, long *vendorID, long *engineID)
  234. ;
  235.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  236.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_GetPreferences
  237.     ENDIF
  238.  
  239. ;
  240. ; extern TQ3Status Q3InteractiveRenderer_SetDoubleBufferBypass(TQ3RendererObject renderer, TQ3Boolean bypass)
  241. ;
  242.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  243.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_SetDoubleBufferBypass
  244.     ENDIF
  245.  
  246. ;
  247. ; extern TQ3Status Q3InteractiveRenderer_GetDoubleBufferBypass(TQ3RendererObject renderer, TQ3Boolean *bypass)
  248. ;
  249.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  250.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_GetDoubleBufferBypass
  251.     ENDIF
  252.  
  253. ;
  254. ; extern TQ3Status Q3InteractiveRenderer_SetRAVEContextHints(TQ3RendererObject renderer, unsigned long RAVEContextHints)
  255. ;
  256.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  257.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_SetRAVEContextHints
  258.     ENDIF
  259.  
  260. ;
  261. ; extern TQ3Status Q3InteractiveRenderer_GetRAVEContextHints(TQ3RendererObject renderer, unsigned long *RAVEContextHints)
  262. ;
  263.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  264.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_GetRAVEContextHints
  265.     ENDIF
  266.  
  267. ;
  268. ; extern TQ3Status Q3InteractiveRenderer_SetRAVETextureFilter(TQ3RendererObject renderer, unsigned long RAVEtextureFilterValue)
  269. ;
  270.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  271.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_SetRAVETextureFilter
  272.     ENDIF
  273.  
  274. ;
  275. ; extern TQ3Status Q3InteractiveRenderer_GetRAVETextureFilter(TQ3RendererObject renderer, unsigned long *RAVEtextureFilterValue)
  276. ;
  277.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  278.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_GetRAVETextureFilter
  279.     ENDIF
  280.  
  281.  
  282. ; ******************************************************************************
  283. ; **                                                                             **
  284. ; **                            Renderer View Tools                                 **
  285. ; **                                                                             **
  286. ; **                    You may only call these methods from a plug-in             **
  287. ; **                                                                             **
  288. ; ****************************************************************************
  289.  
  290. ; *    Call by a renderer to call the user "idle" method, with progress 
  291. ; *    information.
  292. ; *    
  293. ; *    Pass in (view, 0, n) on first call
  294. ; *    Pass in (view, 1..n-1, n) during rendering
  295. ; *    Pass in (view, n, n) upon completion
  296. ; *    
  297. ; *    Note: The user must have supplied an idleProgress method with 
  298. ; *    Q3XView_SetIdleProgressMethod. Otherwise, the generic idle method is
  299. ; *    called with no progress data. e.g. the Q3View_SetIdleMethod method
  300. ; *    is called instead. (current and final are ignored, essentially.)
  301. ; *
  302. ; *    Returns kQ3Failure if rendering is cancelled.
  303.  
  304. ;
  305. ; extern TQ3Status Q3XView_IdleProgress(TQ3ViewObject view, unsigned long current, unsigned long completed)
  306. ;
  307.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  308.         IMPORT_CFM_FUNCTION Q3XView_IdleProgress
  309.     ENDIF
  310.  
  311. ; *    Called by an asynchronous renderer when it completes a frame.
  312.  
  313. ;
  314. ; extern TQ3Status Q3XView_EndFrame(TQ3ViewObject view)
  315. ;
  316.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  317.         IMPORT_CFM_FUNCTION Q3XView_EndFrame
  318.     ENDIF
  319.  
  320.  
  321. ; ******************************************************************************
  322. ; **                                                                             **
  323. ; **                            Renderer AttributeSet Tools                         **
  324. ; **                                                                             **
  325. ; **                    You may only call these methods from a plug-in             **
  326. ; **                                                                             **
  327. ; ****************************************************************************
  328.  
  329. ; *    Faster access to geometry attribute sets.
  330. ; *    
  331. ; *    Returns pointer to INTERNAL data structure for elements and attributes
  332. ; *    in an attributeSet, or NULL if no attribute exists.
  333. ; *    
  334. ; *    For attributes of type kQ3AttributeType..., the internal data structure
  335. ; *    is identical to the data structure used in Q3AttributeSet_Add.
  336.  
  337. ;
  338. ; extern void *Q3XAttributeSet_GetPointer(TQ3AttributeSet attributeSet, TQ3AttributeType attributeType)
  339. ;
  340.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  341.         IMPORT_CFM_FUNCTION Q3XAttributeSet_GetPointer
  342.     ENDIF
  343.  
  344.  
  345.  
  346. kQ3XAttributeMaskNone            EQU        0
  347. kQ3XAttributeMaskSurfaceUV        EQU        $01
  348. kQ3XAttributeMaskShadingUV        EQU        $02
  349. kQ3XAttributeMaskNormal            EQU        $04
  350. kQ3XAttributeMaskAmbientCoefficient EQU    $08
  351. kQ3XAttributeMaskDiffuseColor    EQU        $10
  352. kQ3XAttributeMaskSpecularColor    EQU        $20
  353. kQ3XAttributeMaskSpecularControl EQU    $40
  354. kQ3XAttributeMaskTransparencyColor EQU    $80
  355. kQ3XAttributeMaskSurfaceTangent    EQU        $0100
  356. kQ3XAttributeMaskHighlightState    EQU        $0200
  357. kQ3XAttributeMaskSurfaceShader    EQU        $0400
  358. kQ3XAttributeMaskCustomAttribute EQU    $80000000
  359. kQ3XAttributeMaskAll            EQU        $800007FF
  360. kQ3XAttributeMaskInherited        EQU        $03FF
  361. kQ3XAttributeMaskInterpolated    EQU        $01FF
  362. ; typedef unsigned long                 TQ3XAttributeMask
  363.  
  364. ;
  365. ; extern TQ3XAttributeMask Q3XAttributeSet_GetMask(TQ3AttributeSet attributeSet)
  366. ;
  367.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  368.         IMPORT_CFM_FUNCTION Q3XAttributeSet_GetMask
  369.     ENDIF
  370.  
  371.  
  372. ; ******************************************************************************
  373. ; **                                                                             **
  374. ; **                            Renderer Draw Context Tools                         **
  375. ; **                                                                             **
  376. ; ****************************************************************************
  377.  
  378.  
  379.  
  380. ;
  381. ; extern TQ3Status Q3XDrawContext_GetDrawRegion(TQ3DrawContextObject drawContext, TQ3XDrawRegion *drawRegion)
  382. ;
  383.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  384.         IMPORT_CFM_FUNCTION Q3XDrawContext_GetDrawRegion
  385.     ENDIF
  386.  
  387.  
  388. ; typedef long                            TQ3XDrawContextValidationMasks
  389. kQ3XDrawContextValidationClearFlags EQU    $00000000
  390. kQ3XDrawContextValidationDoubleBuffer EQU $01
  391. kQ3XDrawContextValidationShader    EQU        $02
  392. kQ3XDrawContextValidationClearFunction EQU $04
  393. kQ3XDrawContextValidationActiveBuffer EQU $08
  394. kQ3XDrawContextValidationInternalOffScreen EQU $10
  395. kQ3XDrawContextValidationPane    EQU        $20
  396. kQ3XDrawContextValidationMask    EQU        $40
  397. kQ3XDrawContextValidationDevice    EQU        $80
  398. kQ3XDrawContextValidationWindow    EQU        $0100
  399. kQ3XDrawContextValidationWindowSize EQU    $0200
  400. kQ3XDrawContextValidationWindowClip EQU    $0400
  401. kQ3XDrawContextValidationWindowPosition EQU $0800
  402. kQ3XDrawContextValidationPlatformAttributes EQU $1000
  403. kQ3XDrawContextValidationForegroundShader EQU $2000
  404. kQ3XDrawContextValidationBackgroundShader EQU $4000
  405. kQ3XDrawContextValidationColorPalette EQU $8000
  406. kQ3XDrawContextValidationAll    EQU        $FFFFFFFF
  407. ; typedef unsigned long                 TQ3XDrawContextValidation
  408.  
  409. ;
  410. ; extern TQ3Status Q3XDrawContext_ClearValidationFlags(TQ3DrawContextObject drawContext)
  411. ;
  412.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  413.         IMPORT_CFM_FUNCTION Q3XDrawContext_ClearValidationFlags
  414.     ENDIF
  415.  
  416. ;
  417. ; extern TQ3Status Q3XDrawContext_GetValidationFlags(TQ3DrawContextObject drawContext, TQ3XDrawContextValidation *validationFlags)
  418. ;
  419.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  420.         IMPORT_CFM_FUNCTION Q3XDrawContext_GetValidationFlags
  421.     ENDIF
  422.  
  423.  
  424. ; ******************************************************************************
  425. ; **                                                                             **
  426. ; **                            Renderer Draw Region Tools                         **
  427. ; **                                                                             **
  428. ; ****************************************************************************
  429.  
  430.  
  431. ; typedef long                            TQ3XDevicePixelType
  432.                                                             ; These do not indicate byte ordering   
  433. kQ3XDevicePixelTypeInvalid        EQU        0                    ; Unknown, un-initialized type     
  434. kQ3XDevicePixelTypeRGB32        EQU        1                    ; Alpha:8 (ignored), R:8, G:8, B:8 
  435. kQ3XDevicePixelTypeARGB32        EQU        2                    ; Alpha:8, R:8, G:8, B:8              
  436. kQ3XDevicePixelTypeRGB24        EQU        3                    ; 24 bits/pixel, R:8, G:8, B:8     
  437. kQ3XDevicePixelTypeRGB16        EQU        4                    ; Alpha:1 (ignored), R:5, G:5, B:5 
  438. kQ3XDevicePixelTypeARGB16        EQU        5                    ; Alpha:1, R:5, G:5, B:5              
  439. kQ3XDevicePixelTypeRGB16_565    EQU        6                    ; 16 bits/pixel, R:5, G:6, B:5     
  440. kQ3XDevicePixelTypeIndexed8        EQU        7                    ; 8-bit color table index             
  441. kQ3XDevicePixelTypeIndexed4        EQU        8                    ; 4-bit color table index             
  442. kQ3XDevicePixelTypeIndexed2        EQU        9                    ; 2-bit color table index             
  443. kQ3XDevicePixelTypeIndexed1        EQU        10                    ; 1-bit color table index             
  444.  
  445. ; typedef long                            TQ3XClipMaskState
  446. kQ3XClipMaskFullyExposed        EQU        0
  447. kQ3XClipMaskPartiallyExposed    EQU        1
  448. kQ3XClipMaskNotExposed            EQU        2
  449. TQ3XColorDescriptor        RECORD 0
  450. redShift                 ds.l    1                ; offset: $0 (0)
  451. redMask                     ds.l    1                ; offset: $4 (4)
  452. greenShift                 ds.l    1                ; offset: $8 (8)
  453. greenMask                 ds.l    1                ; offset: $C (12)
  454. blueShift                 ds.l    1                ; offset: $10 (16)
  455. blueMask                 ds.l    1                ; offset: $14 (20)
  456. alphaShift                 ds.l    1                ; offset: $18 (24)
  457. alphaMask                 ds.l    1                ; offset: $1C (28)
  458. sizeof                     EQU *                    ; size:   $20 (32)
  459.                         ENDR
  460. TQ3XDrawRegionDescriptor RECORD 0
  461. width                     ds.l    1                ; offset: $0 (0)
  462. height                     ds.l    1                ; offset: $4 (4)
  463. rowBytes                 ds.l    1                ; offset: $8 (8)
  464. pixelSize                 ds.l    1                ; offset: $C (12)
  465. pixelType                 ds.l    1                ; offset: $10 (16)
  466. colorDescriptor             ds        TQ3XColorDescriptor ; offset: $14 (20)
  467. bitOrder                 ds.l    1                ; offset: $34 (52)
  468. byteOrder                 ds.l    1                ; offset: $38 (56)
  469. clipMask                 ds.l    1                ; offset: $3C (60)
  470. sizeof                     EQU *                    ; size:   $40 (64)
  471.                         ENDR
  472.  
  473. ; typedef long                            TQ3XDrawRegionServicesMasks
  474. kQ3XDrawRegionServicesNoneFlag    EQU        0
  475. kQ3XDrawRegionServicesClearFlag    EQU        $01
  476. kQ3XDrawRegionServicesDontLockDDSurfaceFlag EQU $02
  477. ; typedef unsigned long                 TQ3XDrawRegionServices
  478.  
  479. ;
  480. ; extern TQ3Status Q3XDrawRegion_GetDeviceScaleX(TQ3XDrawRegion drawRegion, float *deviceScaleX)
  481. ;
  482.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  483.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetDeviceScaleX
  484.     ENDIF
  485.  
  486. ;
  487. ; extern TQ3Status Q3XDrawRegion_GetDeviceScaleY(TQ3XDrawRegion drawRegion, float *deviceScaleY)
  488. ;
  489.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  490.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetDeviceScaleY
  491.     ENDIF
  492.  
  493.  
  494. ;
  495. ; extern TQ3Status Q3XDrawRegion_GetDeviceOffsetX(TQ3XDrawRegion drawRegion, float *deviceOffsetX)
  496. ;
  497.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  498.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetDeviceOffsetX
  499.     ENDIF
  500.  
  501. ;
  502. ; extern TQ3Status Q3XDrawRegion_GetDeviceOffsetY(TQ3XDrawRegion drawRegion, float *deviceOffsetX)
  503. ;
  504.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  505.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetDeviceOffsetY
  506.     ENDIF
  507.  
  508.  
  509. ;
  510. ; extern TQ3Status Q3XDrawRegion_GetWindowScaleX(TQ3XDrawRegion drawRegion, float *windowScaleX)
  511. ;
  512.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  513.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetWindowScaleX
  514.     ENDIF
  515.  
  516. ;
  517. ; extern TQ3Status Q3XDrawRegion_GetWindowScaleY(TQ3XDrawRegion drawRegion, float *windowScaleY)
  518. ;
  519.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  520.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetWindowScaleY
  521.     ENDIF
  522.  
  523.  
  524. ;
  525. ; extern TQ3Status Q3XDrawRegion_GetWindowOffsetX(TQ3XDrawRegion drawRegion, float *windowOffsetX)
  526. ;
  527.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  528.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetWindowOffsetX
  529.     ENDIF
  530.  
  531. ;
  532. ; extern TQ3Status Q3XDrawRegion_GetWindowOffsetY(TQ3XDrawRegion drawRegion, float *windowOffsetY)
  533. ;
  534.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  535.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetWindowOffsetY
  536.     ENDIF
  537.  
  538. ;
  539. ; extern TQ3Status Q3XDrawRegion_IsActive(TQ3XDrawRegion drawRegion, TQ3Boolean *isActive)
  540. ;
  541.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  542.         IMPORT_CFM_FUNCTION Q3XDrawRegion_IsActive
  543.     ENDIF
  544.  
  545.  
  546. ;
  547. ; extern TQ3Status Q3XDrawRegion_GetNextRegion(TQ3XDrawRegion drawRegion, TQ3XDrawRegion *nextDrawRegion)
  548. ;
  549.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  550.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetNextRegion
  551.     ENDIF
  552.  
  553. ;  
  554. ; *  One of the next two functions must be called before using a draw region 
  555.  
  556. ; *    Use this Start function if double buffering/image access services from the
  557. ; *    Draw Context are not needed, you may still request clear for example
  558.  
  559. ;
  560. ; extern TQ3Status Q3XDrawRegion_Start(TQ3XDrawRegion drawRegion, TQ3XDrawRegionServices services, TQ3XDrawRegionDescriptor **descriptor)
  561. ;
  562.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  563.         IMPORT_CFM_FUNCTION Q3XDrawRegion_Start
  564.     ENDIF
  565.  
  566. ; *    Use this Start function if double buffering or image access services from 
  567. ; *  the Draw Context are needed.
  568.  
  569. ;
  570. ; extern TQ3Status Q3XDrawRegion_StartAccessToImageBuffer(TQ3XDrawRegion drawRegion, TQ3XDrawRegionServices services, TQ3XDrawRegionDescriptor **descriptor, void **image)
  571. ;
  572.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  573.         IMPORT_CFM_FUNCTION Q3XDrawRegion_StartAccessToImageBuffer
  574.     ENDIF
  575.  
  576. ; *    This function is used to indicate that access to a DrawRegion is ended.
  577.  
  578. ;
  579. ; extern TQ3Status Q3XDrawRegion_End(TQ3XDrawRegion drawRegion)
  580. ;
  581.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  582.         IMPORT_CFM_FUNCTION Q3XDrawRegion_End
  583.     ENDIF
  584.  
  585. ;
  586. ; extern TQ3Status Q3XDrawRegion_GetDeviceTransform(TQ3XDrawRegion drawRegion, TQ3Matrix4x4 **deviceTransform)
  587. ;
  588.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  589.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetDeviceTransform
  590.     ENDIF
  591.  
  592. ;
  593. ; extern TQ3Status Q3XDrawRegion_GetClipFlags(TQ3XDrawRegion drawRegion, TQ3XClipMaskState *clipMaskState)
  594. ;
  595.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  596.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetClipFlags
  597.     ENDIF
  598.  
  599. ;
  600. ; extern TQ3Status Q3XDrawRegion_GetClipMask(TQ3XDrawRegion drawRegion, TQ3Bitmap **clipMask)
  601. ;
  602.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  603.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetClipMask
  604.     ENDIF
  605.  
  606.     IF TARGET_OS_MAC THEN
  607. ;
  608. ; extern TQ3Status Q3XDrawRegion_GetClipRegion(TQ3XDrawRegion drawRegion, RgnHandle *rgnHandle)
  609. ;
  610.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  611.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetClipRegion
  612.     ENDIF
  613.  
  614. ;
  615. ; extern TQ3Status Q3XDrawRegion_GetGDHandle(TQ3XDrawRegion drawRegion, GDHandle *gdHandle)
  616. ;
  617.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  618.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetGDHandle
  619.     ENDIF
  620.  
  621.     ENDIF    ; TARGET_OS_MAC
  622. ;
  623. ; extern TQ3Status Q3XDrawRegion_GetRendererPrivate(TQ3XDrawRegion drawRegion, void **rendererPrivate)
  624. ;
  625.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  626.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetRendererPrivate
  627.     ENDIF
  628.  
  629. ;
  630. ; extern TQ3Status Q3XDrawRegion_SetRendererPrivate(TQ3XDrawRegion drawRegion, const void *rendererPrivate, TQ3XDrawRegionRendererPrivateDeleteMethod deleteMethod)
  631. ;
  632.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  633.         IMPORT_CFM_FUNCTION Q3XDrawRegion_SetRendererPrivate
  634.     ENDIF
  635.  
  636. ;
  637. ; extern TQ3Status Q3XDrawRegion_SetUseDefaultRendererFlag(TQ3XDrawRegion drawRegion, TQ3Boolean flag)
  638. ;
  639.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  640.         IMPORT_CFM_FUNCTION Q3XDrawRegion_SetUseDefaultRendererFlag
  641.     ENDIF
  642.  
  643. ;
  644. ; extern TQ3Status Q3XDrawRegion_GetUseDefaultRendererFlag(TQ3XDrawRegion drawRegion, TQ3Boolean *useDefaultRenderingFlag)
  645. ;
  646.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  647.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetUseDefaultRendererFlag
  648.     ENDIF
  649.  
  650.  
  651.  
  652. ; ******************************************************************************
  653. ; **                                                                             **
  654. ; **                            Renderer Class Methods                             **
  655. ; **                                                                             **
  656. ; ****************************************************************************
  657.  
  658. ; *    Methods from Object
  659. ; *        kQ3XMethodTypeObjectClassRegister
  660. ; *        kQ3XMethodTypeObjectClassUnregister
  661. ; *        kQ3XMethodTypeObjectNew
  662. ; *        kQ3XMethodTypeObjectDelete
  663. ; *        kQ3XMethodTypeObjectRead
  664. ; *        kQ3XMethodTypeObjectTraverse
  665. ; *        kQ3XMethodTypeObjectWrite
  666. ; *        
  667. ; *    Methods from Shared
  668. ; *        kQ3MethodTypeSharedEdited
  669. ; *
  670. ; *    Renderer Methods
  671. ; *    
  672. ; *    The renderer methods should be implemented according to the type
  673. ; *    of renderer being written.
  674. ; *
  675. ; *    For the purposes of documentation, there are two basic types of
  676. ; *    renderers: 
  677. ; *
  678. ; *        Interactive
  679. ; *            Interactive Renderer
  680. ; *            WireFrame Renderer
  681. ; *        
  682. ; *        Deferred
  683. ; *            a ray-tracer
  684. ; *            painter's algorithm renderer (cached in a BSP triangle tree)
  685. ; *            an artistic renderer (simulates a pencil drawing, etc.)
  686. ; *
  687. ; *    The main difference is how each renderer handles incoming state and 
  688. ; *    geometry.
  689. ; *
  690. ; *    An interactive renderer immediately transforms, culls, and shades
  691. ; *    incoming geometry and performs rasterization. For example, in a 
  692. ; *    single-buffered WireFrame renderer, you will see a new triangle
  693. ; *    immediately after Q3Triangle_Draw (if it's visible, of course).
  694. ; *
  695. ; *    A deferred renderer caches the view state and each geometry, 
  696. ; *    converting into any internal queue of drawing commands. Rasterization
  697. ; *    is not actually performed until all data has been submitted.
  698. ; *    
  699. ; *    For example, a ray-tracer may not rasterize anything until the
  700. ; *    end of the rendering loop, or until an EndFrame call is made.
  701.  
  702.  
  703. ; ******************************************************************************
  704. ; **                                                                             **
  705. ; **                        Renderer User Interface Methods                         **
  706. ; **                                                                             **
  707. ; ****************************************************************************
  708.  
  709. ; *    kQ3XMethodTypeRendererIsInteractive
  710. ; *    
  711. ; *    There is no actual method with this - the metahandler simply returns
  712. ; *  "(TQ3XFunctionPointer)kQ3True" for this "method" if the renderer is 
  713. ; *  intended to be used in interactive settings, and   
  714. ; *    "(TQ3XFunctionPointer)kQ3False" otherwise. 
  715. ; *  
  716. ; *  If neither value is specified in the metahandler, the renderer 
  717. ; *  is *assumed to be non-interactive*!!!
  718. ; *    
  719. ; *    OPTIONAL
  720.  
  721.  
  722. kQ3XMethodTypeRendererIsInteractive EQU    'isin'
  723.  
  724. ; *    TQ3XRendererModalConfigureMethod
  725. ; *    
  726. ; *    This method should pop up a modal dialog to edit the renderer settings 
  727. ; *    found in the renderer private. 
  728. ; *    
  729. ; *    dialogAnchor - is platform specific data passed by the client to support
  730. ; *      movable modal dialogs. 
  731. ; *    MacOS: this is a callback to the calling application's event handler.
  732. ; *      The renderer calls this function with events not handled by the 
  733. ; *      settings dialog. This is necessary in order to support movable modal 
  734. ; *      dialogs. An application's event handler must return kQ3True if it 
  735. ; *      handles the event passed to the callback or kQ3False if not. 
  736. ; *      An application which doesn't want to support a movable modal configure
  737. ; *      dialog should pass NULL for the clientEventHandler of TQ3DialogAnchor.
  738. ; *      A renderer should implement a non-movable style dialog in that case.
  739. ; *    Win32: this is the HWND of the owning window (typically an application's
  740. ; *      main window).  (Win32 application modal dialogs are always movable.)
  741. ; *  canceled - returns a boolean inditacating that the user canceled the 
  742. ; *    dialog.
  743. ; *    
  744. ; *    OPTIONAL
  745.  
  746.  
  747. kQ3XMethodTypeRendererModalConfigure EQU 'rdmc'
  748. ; *    kQ3XMethodTypeRendererGetNickNameString
  749. ; *    
  750. ; *        Allows an application to collect the name of the renderer for
  751. ; *        display in a user interface item such as a menu.
  752. ; *    
  753. ; *        If dataBuffer is NULL actualDataSize returns the required size in 
  754. ; *        bytes of a data buffer large enough to store the renderer name. 
  755. ; *
  756. ; *      bufferSize is the actual size of the memory block pointed to by 
  757. ; *        dataBuffer
  758. ; *
  759. ; *        actualDataSize - on return the actual number of bytes written to the
  760. ; *        buffer or if dataBuffer is NULL the required size of dataBuffer
  761. ; *
  762. ; *    OPTIONAL
  763.  
  764.  
  765. kQ3XMethodTypeRendererGetNickNameString EQU 'rdns'
  766. ; *    kQ3XMethodTypeRendererGetConfigurationData
  767. ; *    
  768. ; *        Allows an application to collect private configuration data from the
  769. ; *      renderer which it will then save. For example in a preference file, 
  770. ; *      a registry key (on Windows) or in a style template. An application 
  771. ; *      should tag this data with the renderer's object name.
  772. ; *    
  773. ; *        If dataBuffer is NULL actualDataSize returns the required size in 
  774. ; *        bytes of a data buffer large enough to store private data. 
  775. ; *
  776. ; *      bufferSize is the actual size of the memory block pointed to by 
  777. ; *        dataBuffer
  778. ; *
  779. ; *        actualDataSize - on return the actual number of bytes written to the
  780. ; *        buffer or if dataBuffer is NULL the required size of dataBuffer
  781. ; *
  782. ; *    OPTIONAL
  783.  
  784.  
  785. kQ3XMethodTypeRendererGetConfigurationData EQU 'rdgp'
  786. ; *    TQ3XRendererSetConfigurationDataMethod
  787. ; *    
  788. ; *        Allows an application to pass private configuration data which has
  789. ; *         previously  been obtained from a renderer via 
  790. ; *        Q3Renderer_GetConfigurationData. For example in a preference file or 
  791. ; *        in a style template. An application should tag this data with the 
  792. ; *        renderer's object name.
  793. ; *    
  794. ; *      bufferSize is the actual size of the memory block pointed to by 
  795. ; *        dataBuffer
  796. ; *
  797. ; *    OPTIONAL
  798.  
  799.  
  800. kQ3XMethodTypeRendererSetConfigurationData EQU 'rdsp'
  801. ; ******************************************************************************
  802. ; **                                                                             **
  803. ; **                        Renderer Drawing State Methods                         **
  804. ; **                                                                             **
  805. ; ****************************************************************************
  806.  
  807. ; *    TQ3RendererStartFrame
  808. ; *    
  809. ; *    The StartFrame method is called first at Q3View_StartRendering
  810. ; *    and should:
  811. ; *        - initialize any renderer state to defaults
  812. ; *        - extract any and all useful data from the drawContext
  813. ; *
  814. ; *    If your renderer passed in kQ3RendererFlagClearBuffer at 
  815. ; *    registration, then it should also:
  816. ; *        - clear the drawContext 
  817. ; *    
  818. ; *        When clearing, your renderer may opt to:
  819. ; *        - NOT clear anything (if you touch every pixel, for example)
  820. ; *        - to clear with your own routine, or
  821. ; *        - to use the draw context default clear method by calling 
  822. ; *        Q3DrawContext_Clear. Q3DrawContext_Clear takes advantage of
  823. ; *        any available hardware in the system for clearing.
  824. ; *    
  825. ; *    This call also signals the start of all default submit commands from
  826. ; *    the view. The renderer will receive updates for the default view
  827. ; *    state via its Update methods before StartPass is called.
  828. ; *    
  829. ; *    REQUIRED
  830.  
  831.  
  832. kQ3XMethodTypeRendererStartFrame EQU    'rdcl'
  833. ; *    kQ3XMethodTypeRendererStartPass
  834. ; *    TQ3XRendererStartPassMethod
  835. ; *    
  836. ; *    The StartPass method is called during Q3View_StartRendering but after
  837. ; *    the StartFrame command. It should:
  838. ; *        - collect camera and light information
  839. ; *    
  840. ; *    If your renderer supports deferred camera transformation, camera is the
  841. ; *    main camera which will be submitted in the hierarchy somewhere. It
  842. ; *    is never NULL.
  843. ; *
  844. ; *    If your renderer does not support deferred camera transformation, camera
  845. ; *    is the transformed camera.
  846. ; *
  847. ; *    If your renderer supports deferred light transformation, lights will be
  848. ; *    NULL, and will be submitted to your light draw methods instead.
  849. ; *
  850. ; *    This call signals the end of the default update state, and the start of 
  851. ; *  submit commands from the user to the view.
  852. ; *
  853. ; *    REQUIRED
  854.  
  855.  
  856. kQ3XMethodTypeRendererStartPass    EQU        'rdst'
  857. ; *    kQ3XMethodTypeRendererFlushFrame
  858. ; *    TQ3XRendererFlushFrameMethod
  859. ; *    
  860. ; *    This call is only implemented by asynchronous renderers.
  861. ; *    
  862. ; *    The FlushFrame method is called between the StartPass and EndPass
  863. ; *    methods and is called when the user wishes to flush any asynchronous
  864. ; *    drawing tasks (which draw to the drawcontext), but does not want 
  865. ; *    to block.
  866. ; *    
  867. ; *    The result of this call is that an image should "eventually" appear
  868. ; *    asynchronously.
  869. ; *    
  870. ; *    For asynchronous rendering, this call is non-blocking.
  871. ; *    
  872. ; *    An interactive renderer should ensure that all received
  873. ; *    geometries are drawn in the image.
  874. ; *    
  875. ; *    An interactive renderer that talks to hardware should force
  876. ; *    the hardware to generate an image.
  877. ; *    
  878. ; *    A deferred renderer should exhibit a similar behaviour,
  879. ; *    though it is not required.  A deferred renderer should spawn
  880. ; *    a process that generates a partial image from the currently
  881. ; *    accumulated drawing state. 
  882. ; *    
  883. ; *    However, for renderers such as ray-tracers which generally are
  884. ; *    quite compute-intensive, FlushFrame is not required and is a no-op.
  885. ; *
  886. ; *    OPTIONAL
  887.  
  888.  
  889. kQ3XMethodTypeRendererFlushFrame EQU    'rdfl'
  890. ; *    kQ3XMethodTypeRendererEndPass
  891. ; *    TQ3XRendererEndPassMethod
  892. ; *    
  893. ; *    The EndPass method is called at Q3View_EndRendering and signals
  894. ; *    the end of submit commands to the view.
  895. ; *
  896. ; *    If an error occurs, the renderer should call Q3XError_Post and
  897. ; *    return kQ3ViewStatusError.
  898. ; *    
  899. ; *    If a renderer requires another pass on the renderering data,
  900. ; *    it should return kQ3ViewStatusRetraverse.
  901. ; *    
  902. ; *    If rendering was cancelled, this function will not be called
  903. ; *    and the view will handle returning kQ3ViewStatusCancelled;
  904. ; *    
  905. ; *    Otherwise, your renderer should begin completing the process of 
  906. ; *    generating the image in the drawcontext. If you have buffered
  907. ; *    any drawing data, flush it. RendererEnd should have a similar
  908. ; *    effect as RendererFlushFrame.
  909. ; *    
  910. ; *    If the renderer is synchronous:
  911. ; *        - complete rendering of the entire frame
  912. ; *        if the renderer supports kQ3RendererClassSupportDoubleBuffer
  913. ; *            - Update the front buffer
  914. ; *        else
  915. ; *            - DrawContext will update the front buffer after returning
  916. ; *
  917. ; *    If the renderer is asynchronous
  918. ; *        - spawn rendering thread for entire frame
  919. ; *        if the renderer supports kQ3RendererClassSupportDoubleBuffer,
  920. ; *            - you must eventually update the front buffer asynchronously
  921. ; *        else
  922. ; *            - you must eventually update the back buffer asynchronously
  923. ; *            
  924. ; *    REQUIRED
  925.  
  926.  
  927. kQ3XMethodTypeRendererEndPass    EQU        'rded'
  928. ; *    kQ3XMethodTypeRendererEndFrame
  929. ; *    TQ3XRendererEndFrame
  930. ; *    
  931. ; *    This call is only implemented by asynchronous renderers.
  932. ; *
  933. ; *    The EndFrame method is called from Q3View_Sync, which is
  934. ; *    called after Q3View_EndRendering and signals that the user
  935. ; *    wishes to see the completed image and is willing to block.
  936. ; *    
  937. ; *    If your renderer supports kQ3RendererFlagDoubleBuffer
  938. ; *        - update the front buffer completely 
  939. ; *    else
  940. ; *        - update the back buffer completely
  941. ; *
  942. ; *    This call is equivalent in functionality to RendererFlushFrame
  943. ; *    but blocks until the image is completed.
  944. ; *    
  945. ; *    If no method is supplied, the default is a no-op.
  946. ; *    
  947. ; *    NOTE: Registering a method of this type indicates that your renderer will
  948. ; *    be rendering after Q3View_EndRendering has been called.
  949. ; *    
  950. ; *    OPTIONAL
  951.  
  952.  
  953. kQ3XMethodTypeRendererEndFrame    EQU        'rdsy'
  954. ; *    The RendererCancel method is called after Q3View_StartRendering
  955. ; *    and signals the termination of all rendering operations.
  956. ; *
  957. ; *    A renderer should clean up any cached data, and cancel all 
  958. ; *    rendering operations.
  959. ; *    
  960. ; *    If called before Q3View_EndRendering, the RendererEnd method
  961. ; *    is NOT called.
  962. ; *    
  963. ; *    If called after Q3View_EndRendering, the renderer should kill
  964. ; *    any threads and terminate any further rendering.
  965. ; *    
  966. ; *    REQUIRED
  967.  
  968.  
  969. kQ3XMethodTypeRendererCancel    EQU        'rdab'
  970. ; ******************************************************************************
  971. ; **                                                                             **
  972. ; **                        Renderer DrawContext Methods                         **
  973. ; **                                                                             **
  974. ; ****************************************************************************
  975.  
  976. ; *    kQ3XMethodTypeRendererPush
  977. ; *    TQ3XRendererPushMethod
  978. ; *    
  979. ; *    kQ3XMethodTypeRendererPop
  980. ; *    TQ3XRendererPopMethod
  981. ; *    
  982. ; *    These methods are called whenever the graphics state in the view
  983. ; *    is pushed or popped. The user may isolate state by calling:
  984. ; *    
  985. ; *    Q3Attribute_Submit(kQ3AttributeTypeDiffuseColor, &red, view);
  986. ; *    Q3Attribute_Submit(kQ3AttributeTypeTransparencyColor, &blue, view);
  987. ; *    Q3Attribute_Submit(kQ3AttributeTypeSpecularColor, &white, view);
  988. ; *    Q3Box_Submit(&unitBox, view);
  989. ; *    Q3TranslateTransform_Submit(&unitVector, view);
  990. ; *    Q3Push_Submit(view);
  991. ; *        Q3Attribute_Submit(kQ3AttributeTypeDiffuseColor, &blue, view);
  992. ; *        Q3Attribute_Submit(kQ3AttributeTypeTransparencyColor, &green, view);
  993. ; *        Q3Box_Submit(&unitBox, view);
  994. ; *    Q3Pop_Submit(view);    
  995. ; *    Q3TranslateTransform_Submit(&unitVector, view);
  996. ; *    Q3Box_Submit(&unitBox, view);
  997. ; *    
  998. ; *    or by submitting a display group which pushes and pops.
  999. ; *    
  1000. ; *    If you support RendererPush and RendererPop in your renderer:
  1001. ; *        - you must maintain your drawing state as a stack, as well.
  1002. ; *        - you will not be updated with the popped state after
  1003. ; *            RendererPop is called.
  1004. ; *
  1005. ; *    If you do not support Push and Pop in your renderer:
  1006. ; *        - you may maintain a single copy of the drawing state.
  1007. ; *        - you will be updated with changed fields after the view stack is
  1008. ; *            popped.
  1009. ; *
  1010. ; *    A renderer that supports Push and Pop gets called in the following
  1011. ; *    sequence (from example above):
  1012. ; *    
  1013. ; *    RendererUpdateAttributeDiffuseColor(&red,...)
  1014. ; *    RendererUpdateAttributeTransparencyColor(&blue,...)
  1015. ; *    RendererUpdateAttributeSpecularColor(&white,...)
  1016. ; *    RendererUpdateMatrixLocalToWorld(...)
  1017. ; *    RendererSubmitGeometryBox(...)
  1018. ; *    RendererPush(...)
  1019. ; *        RendererUpdateAttributeDiffuseColor(&blue,...)
  1020. ; *        RendererUpdateAttributeTransparencyColor(&green,...)
  1021. ; *        RendererSubmitGeometryBox(...)
  1022. ; *    RendererPop(...)
  1023. ; *    RendererUpdateMatrixLocalToWorld(...)
  1024. ; *    RendererSubmitGeometryBox(...)
  1025. ; *
  1026. ; *    A renderer that does not supports Push and Pop gets called in the
  1027. ; *    following sequence:
  1028. ; *    
  1029. ; *    RendererUpdateAttributeDiffuseColor(&red,...)
  1030. ; *    RendererUpdateAttributeTransparencyColor(&blue,...)
  1031. ; *    RendererUpdateAttributeSpecularColor(&white,...)
  1032. ; *    RendererUpdateMatrixLocalToWorld(...)
  1033. ; *    RendererSubmitGeometryBox(...)
  1034. ; *        RendererUpdateAttributeDiffuseColor(&blue,...)
  1035. ; *        RendererUpdateAttributeTransparencyColor(&green,...)
  1036. ; *        RendererSubmitGeometryBox(...)
  1037. ; *    RendererUpdateAttributeDiffuseColor(&red,...)
  1038. ; *    RendererUpdateAttributeTransparencyColor(&blue,...)
  1039. ; *    RendererUpdateMatrixLocalToWorld(...)
  1040. ; *    RendererSubmitGeometryBox(...)
  1041. ; *    
  1042.  
  1043.  
  1044. kQ3XMethodTypeRendererPush        EQU        'rdps'
  1045.  
  1046. kQ3XMethodTypeRendererPop        EQU        'rdpo'
  1047. ; ******************************************************************************
  1048. ; **                                                                             **
  1049. ; **                            Renderer Cull Methods                             **
  1050. ; **                                                                             **
  1051. ; ****************************************************************************
  1052.  
  1053. ; *    kQ3XMethodTypeRendererIsBoundingBoxVisible
  1054. ; *    TQ3XRendererIsBoundingBoxVisibleMethod
  1055. ; *    
  1056. ; *    This method is called to cull complex groups and geometries 
  1057. ; *    given their bounding box in local space.
  1058. ; *    
  1059. ; *    It should transform the local-space bounding box coordinates to
  1060. ; *    frustum space and return a TQ3Boolean return value indicating
  1061. ; *    whether the box appears within the viewing frustum.
  1062. ; *    
  1063. ; *    If no method is supplied, the default behavior is to return
  1064. ; *    kQ3True.
  1065. ; *    
  1066.  
  1067.  
  1068. kQ3XMethodTypeRendererIsBoundingBoxVisible EQU 'rdbx'
  1069.  
  1070. ; ******************************************************************************
  1071. ; **                                                                             **
  1072. ; **                        Renderer Object Support Methods                         **
  1073. ; **                                                                             **
  1074. ; ****************************************************************************
  1075.  
  1076. ; *    Drawing methods (Geometry, Camera, Lights)
  1077. ; *
  1078.  
  1079. ; *    Geometry MetaHandler
  1080. ; *    
  1081. ; *    This metaHandler is required to support 
  1082. ; *    
  1083. ; *    kQ3GeometryTypeTriangle
  1084. ; *    kQ3GeometryTypeLine
  1085. ; *    kQ3GeometryTypePoint
  1086. ; *    kQ3GeometryTypeMarker
  1087. ; *    kQ3GeometryTypePixmapMarker
  1088. ; *    
  1089. ; *    REQUIRED
  1090.  
  1091.  
  1092. kQ3XMethodTypeRendererSubmitGeometryMetaHandler EQU 'rdgm'
  1093. ; *    The TQ3XRendererSubmitGeometryMetaHandlerMethod switches on geometryType
  1094. ; *    of kQ3GeometryTypeFoo and returns methods of type:
  1095.  
  1096. ; *    Camera MetaHandler
  1097. ; *    
  1098. ; *    This metaHandler, if supplied, indicates that your renderer
  1099. ; *    handles deferred transformation of the main camera within a scene.
  1100. ; *    
  1101. ; *    If not supplied, or an unsupported camera is used, the view will do
  1102. ; *    the transformation for the renderer and pass in a camera in the 
  1103. ; *    StartPass method.
  1104. ; *    
  1105. ; *    OPTIONAL
  1106.  
  1107.  
  1108. kQ3XMethodTypeRendererSubmitCameraMetaHandler EQU 'rdcm'
  1109. ; *    The TQ3XRendererSubmitCameraMetaHandlerMethod switches on cameraType
  1110. ; *    of kQ3CameraTypeFoo and returns methods of type:
  1111.  
  1112. ; *    Light MetaHandler
  1113. ; *    
  1114. ; *    This metaHandler, if supplied, indicates that your renderer
  1115. ; *    handles deferred transformation of lights within a scene.
  1116. ; *    
  1117. ; *    If an unsupported light is encountered, it is ignored.
  1118. ; *
  1119. ; *    OPTIONAL
  1120.  
  1121.  
  1122. kQ3XMethodTypeRendererSubmitLightMetaHandler EQU 'rdlg'
  1123. ; *    The TQ3XRendererSubmitLightMetaHandlerMethod switches on lightType
  1124. ; *    of kQ3LightTypeFoo and returns methods of type:
  1125.  
  1126. ; *
  1127. ; *    Update methods
  1128. ; *
  1129. ; *    They are called whenever the state has changed. If the renderer supports
  1130. ; *    the RendererPush and RendererPop methods, it must maintain its own state
  1131. ; *    stack. Updates are not called for changed data when the view stack is
  1132. ; *    popped.
  1133. ; *
  1134. ; *    See the comments for the RendererPush and RendererPop methods above
  1135. ; *    for an example of how data is updated.
  1136. ; *
  1137.  
  1138. ; *    Style
  1139.  
  1140.  
  1141. kQ3XMethodTypeRendererUpdateStyleMetaHandler EQU 'rdyu'
  1142. ; *    The TQ3XRendererUpdateStyleMetaHandlerMethod switches on styleType
  1143. ; *    of kQ3StyleTypeFoo and returns methods of type:
  1144.  
  1145. ; *    Attributes
  1146.  
  1147.  
  1148. kQ3XMethodTypeRendererUpdateAttributeMetaHandler EQU 'rdau'
  1149. ; *    The TQ3XRendererUpdateStyleMetaHandlerMethod switches on attributeType
  1150. ; *    of kQ3AttributeTypeFoo and returns methods of type:
  1151.  
  1152. ; *    Shaders
  1153.  
  1154.  
  1155. kQ3XMethodTypeRendererUpdateShaderMetaHandler EQU 'rdsu'
  1156. ; *    The TQ3XRendererUpdateShaderMetaHandlerMethod switches on shaderType
  1157. ; *    of kQ3ShaderTypeFoo and returns methods of type:
  1158.  
  1159. ; *    Matrices
  1160.  
  1161.  
  1162. kQ3XMethodTypeRendererUpdateMatrixMetaHandler EQU 'rdxu'
  1163. ; typedef TQ3XMetaHandler                 TQ3XRendererUpdateMatrixMetaHandlerMethod
  1164.  
  1165. ; *    The TQ3XRendererUpdateShaderMetaHandlerMethod switches on methods
  1166. ; *    of the form kQ3MethodTypeRendererUpdateMatrixFoo:
  1167.  
  1168.  
  1169. kQ3XMethodTypeRendererUpdateMatrixLocalToWorld EQU 'ulwx'
  1170.  
  1171. kQ3XMethodTypeRendererUpdateMatrixLocalToWorldInverse EQU 'ulwi'
  1172.  
  1173. kQ3XMethodTypeRendererUpdateMatrixLocalToWorldInverseTranspose EQU 'ulwt'
  1174.  
  1175. kQ3XMethodTypeRendererUpdateMatrixLocalToCamera EQU 'ulcx'
  1176.  
  1177. kQ3XMethodTypeRendererUpdateMatrixLocalToFrustum EQU 'ulfx'
  1178.  
  1179. kQ3XMethodTypeRendererUpdateMatrixWorldToFrustum EQU 'uwfx'
  1180. ; *    and returns methods of type:
  1181.  
  1182.  
  1183.     ENDIF ; __QD3DRENDERER__ 
  1184.  
  1185.